//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.UIDesigner.Monitor
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Collections.ObjectModel;
    using System.Collections;

    /// <summary>
    /// Interaction logic for InputOutputView.xaml
    /// </summary>
    public sealed partial class InputOutputView : UserControl
    {
        public InputOutputView()
        {
            InitializeComponent();
        }

        public InputOutputPresentationModel Model
        {
            get { return this.DataContext as InputOutputPresentationModel; }
            set { this.DataContext = value; }
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public class ComplexDataTemplateSelector : DataTemplateSelector
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="item"></param>
        /// <param name="container"></param>
        /// <returns></returns>
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            string type = item.GetType().Name;
            string dataTemplateToSearch = type + "_template";
            return (DataTemplate)((FrameworkElement)container).FindResource(dataTemplateToSearch);
        }
    }
}
